home *** CD-ROM | disk | FTP | other *** search
/ Programmer Power Tools / Programmer Power Tools.iso / surfmodl / surfm203.arc / SURFSRC.ARC / MINMAX.INC < prev    next >
Text File  |  1987-01-05  |  784b  |  28 lines

  1. procedure MINMAX (var Surfmin, Surfmax: surfaces; Nsurf: integer);
  2. { Calculate the minimum and maximum Ztran coordinates of each surface }
  3.  
  4. var Surf: integer;                   { surface # }
  5.     Vert: integer;                   { vertex # }
  6.     Zval: real;                      { Z-coord of node }
  7.  
  8. begin
  9. {$ifdef BIGMEM}
  10. with ptrf^ do with ptrh^ do
  11. begin
  12. {$endif}
  13.   for Surf := 1 to Nsurf do begin
  14.     Surfmin[Surf] := 9999.0;
  15.     Surfmax[Surf] := -9999.0;
  16.     for Vert := 1 to Nvert[Surf] do begin
  17.       Zval := Ztran[Konnec (Surf, Vert)];
  18.       if (Zval < Surfmin[Surf]) then
  19.         Surfmin[Surf] := Zval;
  20.       if (Zval > Surfmax[Surf]) then
  21.         Surfmax[Surf] := Zval;
  22.     end;
  23.   end;
  24. {$ifdef BIGMEM}
  25. end; {with}
  26. {$endif}
  27. end; { procedure MINMAX }
  28.